import http from "./http";

// 用户相关API
export const userApi = {
  login: (username, password) =>
    http.post("/auth/login", { username, password }),
  register: (userData) => http.post("/auth/register", userData),
  getProfile: () => http.get("/user/profile"),
  updateProfile: (data) => http.put("/user/profile", data),
};

// 产品相关API
export const productApi = {
  getList: (params) => http.get("/products", { params }),
  getById: (id) => http.get(`/products/${id}`),
  create: (data) => http.post("/products", data),
  update: (id, data) => http.put(`/products/${id}`, data),
  delete: (id) => http.delete(`/products/${id}`),
};

// 可以根据需要添加更多API模块
